#!/usr/bin/python

import sys
import Image

def vertical_select(inf, idx):
	im = Image.open(inf)
        nim = im.copy()
        (width, height) = im.size

	f = open('/tmp/data', 'w')
	
	pix = nim.load()
	for y in range(height):
		print pix[idx,y]
		f.write(str(pix[idx, y])+'\n')
	f.close()

		
	
	
	
if __name__ == '__main__':
        argvs = sys.argv
        argc  = len(argvs)
        if ( argc != 3 ):
                print "Usage: tool <FileName> <idx>"
                sys.exit(1)
        vertical_select(argvs[1], int(argvs[2]))




	
